/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c), 2003-2011,  Jin Chen and Alan M. MacEachren, GeoVISTA Center, Penn State University
 * Licensed under Simplified BSD License
 *
 *
 * @author: jin Chen 
 * @date: May 28, 2005$
 * @version: 1.0
 */
package edu.psu.geovista.app.hce.clustering.model;

public class DfLCluster extends DfBCluster implements LCluster,Comparable {
    private String id;
    private int dtIndex; // 
    private int lfindex;// 

    public DfLCluster() {
        //this.setLeaf(true);
        //this.setRoot(true);
        //setLevel(0);
    }
    public DfLCluster(int observationId) {
        //this.dataIndex = observationId;
        setDtIndex(observationId);
    }

    public int getDtIndex() {
        return dtIndex;
    }

    public void setDtIndex(int dtIndex) {
        this.dtIndex = dtIndex;
    }
     public int[] getIds() {
        return new int[]{getDtIndex()};  //calculate
    }

    public int getLfindex() {
        return lfindex;
    }

    public void setLfindex(int lfindex) {
        this.lfindex = lfindex;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int compareTo(Object o) {
        DfLCluster another=(DfLCluster) o;
        if(this.getLfindex() <another.getLfindex() ){
              return -1;
        }
        else if(this.getLfindex() >another.getLfindex() ){
              return 1;
        }
        else
            return 0;  //To change body of implemented methods use File | Settings | File Templates.
    }
}
